home *** CD-ROM | disk | FTP | other *** search
/ Windows 6-Pak - Disc 4 / Windows 6-Pak (InfoMagic) (Disc 4) (1999).ISO / Text-Chat-Scripts / pp-320m.exe / pp300 / a-main5.mrc < prev    next >
Text File  |  1998-08-15  |  29KB  |  602 lines

  1. ; -----------------------------------------------------
  2. ; Peace and Protection (by misspai)
  3. ; -----------------------------------------------------
  4. ; Main (normal) aliases
  5. ; (Final section)
  6. ; -----------------------------------------------------
  7. ; Blacklist
  8. ; -----------------------------------------------------
  9. black {
  10.   set %.+bb.speak $true | set %.+bb.speak1st $true
  11.   if ($_ischan($1)) { set %.bb.chan $1 | set %.bb.chd $1 | set %.bb.nick $2 | set %.bb.msg $3- }
  12.   else { set %.bb.chan * | set %.bb.chd all channels | set %.bb.nick $1 | set %.bb.msg $2- }
  13.   if ($gettok(%.bb.msg,1,32) == -q) { set %.bb.msg $gettok(%.bb.msg,2-,32) | set %.+bb.speak $false }
  14.   elseif ($gettok(%.bb.msg,1,32) == -s) { set %.bb.msg $gettok(%.bb.msg,2-,32) | set %.+bb.speak $false | set %.+bb.speak1st $false }
  15.   if (%.bb.nick == $null) _quickhelp /black
  16.   if ($_not($_ismask(%.bb.nick))) {
  17.     if (%+nick.complete.cmd) {
  18.       if (%.bb.chan == $null) set %.bb.comp $_nickglob(%.bb.nick)
  19.       else set %.bb.comp $_nickcomp(%.bb.nick,%.bb.chan)
  20.       if (%.bb.comp != $null) set %.bb.nick %.bb.comp
  21.     }
  22.     if ($address(%.bb.nick,5) == $null) {
  23.       if (%.bb.chan == *) _lookup %.bb.nick 3 black , $2-
  24.       else _lookup %.bb.nick 3 black %.bb.chan , $3-
  25.     }
  26.     set %.bb.nick $_ppmask(%.bb.nick,3)
  27.   }
  28.   set %.bb.me $me $+ ! $+ %-my.address
  29.   if (%.bb.nick iswm %.bb.me) _error Blacklist %col.att $+ cancelled- address of target matches your address!
  30.   set %.bb.old $_ppblk(%.bb.nick)
  31.   if ($gettok(%.bb.msg,1,32) == -r) {
  32.     if (%.bb.old == $null) _error No existing blacklist entry for %.bb.nick $+ .
  33.     elseif (%.+bb.speak1st) disps Removing blacklist entry for %col.target $+ %.bb.nick $+ 
  34.     set %.bb.num $_numtok(32,%.bb.old)
  35.     :reml
  36.     set %.bb.rem $gettok(%.bb.old,%.bb.num,32)
  37.     _remblk %.bb.nick $+ > $+ %.bb.rem
  38.     if ($_vd(.bb.num) > 0) goto reml
  39.     _remblk %.bb.nick
  40.     .ruser 1,black %.bb.nick
  41.     return
  42.   }
  43.   if ($gettok(%.bb.msg,1,32) == -k) {
  44.     _remblk %.bb.nick $+ > $+ %.bb.chan
  45.     set %.bb.old $remtok(%.bb.old,%.bb.chan,32)
  46.     if (%.bb.old == $null) {
  47.       _remblk %.bb.nick
  48.       .ruser 1,black %.bb.nick
  49.     }
  50.     else _writeblk %.bb.nick %.bb.old
  51.     return
  52.   }
  53.   if ($gettok(%.bb.msg,1,32) == -w) {
  54.     set %.bb.msg $gettok(%.bb.msg,2-,32)
  55.     if ($findtok(%.bb.old,%.bb.chan,32) != $null) _error Blacklist entry for  $+ %.bb.nick $+  on %.bb.chd already exists!
  56.   }
  57.   if (%.bb.msg == $null) set %.bb.msg Reason not given.
  58.   if (%.+bb.speak1st) disps  Blacklisting  - %col.target $+ %.bb.nick $+  from %col.target $+ %.bb.chd $+  ( $+ %.bb.msg $+ )
  59.   _writeblk %.bb.nick $addtok(%.bb.old,%.bb.chan,32)
  60.   _writeblk %.bb.nick $+ > $+ %.bb.chan %.bb.msg
  61.   .auser 1,black %.bb.nick
  62.   unset %.bb.targ
  63.   set %.bb.chnm 1
  64.   :chloop
  65.   if (%.bb.chan == *) set %.bb.ch $chan(%.bb.chnm)
  66.   else set %.bb.ch %.bb.chan
  67.   if (%.bb.ch == $null) {
  68.     if ((%.bb.chnm == 1) && (%.+bb.speak)) disps (not on any channels, blacklist entry still made.)
  69.     goto note
  70.   }
  71.   if ($me !isop %.bb.ch) { if (%.+bb.speak) disps (not an op on %col.target $+ %.bb.ch $+ , no kickbans performed, blacklist entry still made.) | goto next }
  72.   set %.bb.num $ialchan(%.bb.nick,%.bb.ch,0)
  73.   if (%.bb.num == 0) { if (%.+bb.speak) disps (no matching users on %col.target $+ %.bb.ch $+ , blacklist entry still made.) | goto next }
  74.   fdop %.bb.ch %.bb.nick
  75.   .raw mode %.bb.ch +b %.bb.nick
  76.   if (%autounban.black > 0) tunban $calc(%autounban.black * 60) %.bb.ch %.bb.nick
  77.   set %_recent.ban. [ $+ [ %.bb.ch ] ] %.bb.nick
  78.   :nloop
  79.   set %.bb.nk $ialchan(%.bb.nick,%.bb.ch,%.bb.num).nick
  80.   kick %.bb.ch %.bb.nk $_blackmsg(Kicks,Blacklist,$_s2f(%.bb.chd),%.bb.nk,%.bb.nick,%.bb.msg)
  81.   set %.bb.targ $addtok(%.bb.targ,%.bb.nk,44)
  82.   if ($_vd(.bb.num) > 0) goto nloop
  83.   :next
  84.   if (%.bb.chan == *) { inc %.bb.chnm | goto chloop }
  85.   :note
  86.   if ((%.bb.targ != $null) && (%+notice.on.blacklist)) n %.bb.targ $_blackmsg(Misc,BlackNotice,$_s2f(%.bb.chd),%.bb.nk,%.bb.nick,%.bb.msg)
  87. }
  88. ; -----------------------------------------------------
  89. ; Favorite channels
  90. ; -----------------------------------------------------
  91. fav {
  92.   if ($1 == $null) _quickhelp /fav
  93.   if (c isin $1) { _writecfg misc Favorites | _remcfg Favorites | dispa List of favorite channels cleared. | return }
  94.   if (s isin $1) {
  95.     if ($2 != $null) _writecfg misc AutoFavorites $_o2tf($2)
  96.     dispa Join favorites on signon: %col.info1 $+ $_tf2o($_ppcfg(Misc,AutoFavorites))
  97.     return
  98.   }
  99.   if ($_ppcfg(misc,favoritesbynet)) set %.fv.serv (for %pp.net $+ )
  100.   else unset %.fv.serv
  101.   if ((a isin $1) || (r isin $1)) {
  102.     if ($2 == $null) {
  103.       if ($chan($active) != $active) _error You must use this in a channel or specify a target channel.
  104.       set %.fv.targ $active
  105.     }
  106.     else set %.fv.targ $_patch($_s2c($2-))
  107.     set %.fv.num 1
  108.     :loop
  109.     set %.fv.todo $gettok(%.fv.targ,%.fv.num,44)
  110.     if (a isin $1) {
  111.       if ($findtok($_favorites,%.fv.todo,44) != $null) dispa %col.target $+ %.fv.todo $+  is already in your favorites. %.fv.serv
  112.       else {
  113.         if (%.fv.serv == $null) { _writecfg misc Favorites $addtok($_favorites,%.fv.todo,44) | dispa %col.target $+ %.fv.todo $+  added to favorite channels. }
  114.         else { _writecfg Favorites %pp.net $addtok($_favorites,%.fv.todo,44) | dispa %col.target $+ %.fv.todo $+  added to favorite channels. %.fv.serv }
  115.       }
  116.     }
  117.     else {
  118.       if ($findtok($_favorites,%.fv.todo,44) == $null) dispa %col.target $+ %.fv.todo $+  is not in your favorites. %.fv.serv
  119.       else {
  120.         if (%.fv.serv == $null) { _writecfg misc Favorites $remtok($_favorites,%.fv.todo,44) | dispa %col.target $+ %.fv.todo $+  removed from favorite channels. }
  121.         else { _writecfg Favorites %pp.net $remtok($_favorites,%.fv.todo,44) | dispa %col.target $+ %.fv.todo $+  removed from favorite channels. %.fv.serv }
  122.       }
  123.     }
  124.     if ($_vi(.fv.num) <= $_numtok(44,%.fv.targ)) goto loop
  125.   }
  126.   if (v isin $1) {
  127.     if ($_favorites == $null) { dispa You have no favorite channels defined. %.fv.serv | return }
  128.     else dispa Your current favorites: %.fv.serv %col.info1 $+ $_favorites %col.option $+ (F11 to join)
  129.   }
  130.   if (j isin $1) {
  131.     if ($_favorites == $null) dispa You have no favorite channels to join. %.fv.serv
  132.     else { dispa Joining favorite channels... %.fv.serv | j $_favorites $_keys($_favorites) }
  133.   }
  134. }  
  135. autoj fav j
  136. ; -----------------------------------------------------
  137. ; Userlevel setting/modification
  138. ; -----------------------------------------------------
  139. userlevel {
  140.   if ($1 == $null) _quickhelp /userlevel
  141.   set %.lvl.nick $_nickglob($1)
  142.   if ((%.lvl.nick == $me) && (* !isin $1)) { disp %.lvl.nick == $me | _error Don't add yourself to the userlist, it's unneeded and will only cause problems. }
  143.   if (($_ismask($1) == $false) && ($address(%.lvl.nick,5) == $null)) _lookup %.lvl.nick ! userlevel , $2-
  144.   if (* isin $1) set %.lvl.addr $1
  145.   else {
  146.     if (@ !isin %.lvl.nick) set %.lvl.addr $maddress($address(%.lvl.nick,5))
  147.     else set %.lvl.addr $maddress(%.lvl.nick)
  148.     if (%.lvl.addr == $null) set %.lvl.addr $_ppmask(%.lvl.nick,3)
  149.   }
  150.   if ($2 == $null) {
  151.     set %.lvl $level(%.lvl.addr)
  152.     if ((%.lvl == 1) || (%.lvl == $null)) dispa %col.target $+ %.lvl.addr $+  has no current user level.
  153.     else {
  154.       set %.lvl.aka $readini $_ppdir $+ userlist.ini nick %.lvl.addr
  155.       if ((%.lvl.nick != $null) && ($_not($_ismask(%.lvl.nick)))) {
  156.         set %.lvl.addr %.lvl.nick $+  ( $+ %.lvl.addr $+ )
  157.         if (%.lvl.aka == %.lvl.nick) unset %.lvl.aka
  158.       }
  159.       if (%.lvl.aka == $null) dispa User level of %col.target $+ %.lvl.addr $+  - %col.dark $+ $_s2cs($_c2s($remove(%.lvl,=)))
  160.       else dispa User level of %col.target $+ %.lvl.addr $+  (aka %col.target $+ %.lvl.aka $+ ) - %col.dark $+ $_s2cs($_c2s($remove(%.lvl,=)))
  161.     }
  162.     return
  163.   }
  164.   set %.lvl.act Adding
  165.   set %.lvl $remove($remove($2,-),+)
  166.   if (- isin $2) set %.lvl.act Removing
  167.   if (%.lvl isnum) set %.lvl.act Setting
  168.   if ($left(%.lvl,1) == v) set %.lvl voice
  169.   elseif ($left(%.lvl,1) == s) set %.lvl send
  170.   elseif ($left(%.lvl,3) == col) {
  171.     set %.num $right(%.lvl,2)
  172.     if (%.num !isnum) set %.num $right(%.lvl,1)
  173.     if (%.num !isnum) set %.num 1
  174.     set %.lvl color $+ $_lpad(2,0,%.num)
  175.   }
  176.   elseif ($left(%.lvl,1) == c) set %.lvl chat
  177.   elseif ($left(%.lvl,3) == nop) set %.lvl nopw
  178.   elseif ($left(%.lvl,1) == n) set %.lvl nodcc
  179.   elseif ($left(%.lvl,1) == @) set %.lvl $remove(%.lvl,@)
  180.   elseif (op isin %.lvl) set %.lvl op
  181.   elseif ((%.lvl !isnum) || (%.lvl !isnum 1-199)) _error Unknown or illegal user level  $+ $2 $+ .
  182.   if ($level(%.lvl.addr) == 1) {
  183.     writeini $_ppdir $+ userlist.ini seen %.lvl.addr $ctime Added
  184.     if ((* !isin $gettok($1,1,33)) && (? !isin $gettok($1,1,33))) writeini $_ppdir $+ userlist.ini nick %.lvl.addr $gettok($1,1,33)
  185.   }
  186.   elseif ($null == $readini $_ppdir $+ userlist.ini nick %.lvl.addr) {
  187.     if ((* !isin $gettok($1,1,33)) && (? !isin $gettok($1,1,33))) writeini $_ppdir $+ userlist.ini nick %.lvl.addr $gettok($1,1,33)
  188.   }
  189.   if (%.lvl != op) {
  190.     if ($3 != -q) dispa %.lvl.act user level of %col.info1 $+ %.lvl $+  for user address %col.target $+ %.lvl.addr $+ ...
  191.     if (%.lvl.act != Removing) {
  192.       set %.lvl.old $gettok($level(%.lvl.addr),1,44)
  193.       if (($level(%.lvl.addr) == 1) && (%.lvl !isnum)) .auser -a 1 %.lvl.addr
  194.       .auser -a %.lvl %.lvl.addr
  195.       if ((%.lvl.old isnum) && (%.lvl isnum) && (%.lvl.old != %.lvl)) .ruser %.lvl.old %.lvl.addr
  196.     }
  197.     else .ruser %.lvl %.lvl.addr
  198.   }
  199.   else {
  200.     if ($3 == -q) set %.lvl.chan $4
  201.     else set %.lvl.chan $3
  202.     if (%.lvl.chan == $null) { set %.lvl.chan Any | set %.lvl.tell all channels }
  203.     else set %.lvl.tell %.lvl.chan
  204.     if (%.lvl.act == Adding) set %.lvl.help (user can type /ctcp $me help for help)
  205.     else unset %.lvl.help
  206.     if ($3 != -q) dispa %.lvl.act ops on %col.info1 $+ %.lvl.tell $+  for user address %col.target $+ %.lvl.addr $+ ... %.lvl.help
  207.     if (%.lvl.act == Adding) {
  208.       if ($findtok(%opchan. [ $+ [ %.lvl.addr ] ] ,%.lvl.chan,32) != $null) { if ($3 != -q) return | _error  $+ %.lvl.addr $+  already has ops access on %.lvl.tell $+ . }
  209.       set %.lvl.old $gettok($level(%.lvl.addr),1,44)
  210.       if ($level(%.lvl.addr) == 1) .auser -a 1 %.lvl.addr
  211.       .auser -a %.lvl %.lvl.addr
  212.       set %opchan. [ $+ [ %.lvl.addr ] ] %opchan. [ $+ [ %.lvl.addr ] ] %.lvl.chan
  213.       if ((%oppass. [ $+ [ %.lvl.addr ] ] == $null) && (nopw !isin %.lvl.old)) dispa %col.target $+ %.lvl.addr $+  has not set a password; they should use /ctcp $me pass <newpass>
  214.     }
  215.     else {
  216.       if (%.lvl.chan == any) { set %opchan. [ $+ [ %.lvl.addr ] ] | set %oppass. [ $+ [ %.lvl.addr ] ] | .ruser %.lvl %.lvl.addr }
  217.       else {
  218.         if ($findtok(%opchan. [ $+ [ %.lvl.addr ] ] ,%.lvl.chan,32) == $null) { if ($3 != -q) return | _error  $+ %.lvl.addr $+  doesn't have ops access on %.lvl.tell $+ . }
  219.         set %.lvl.old %opchan. [ $+ [ %.lvl.addr ] ]
  220.         set %opchan. [ $+ [ %.lvl.addr ] ] $remtok(%.lvl.old,%.lvl.chan,32)
  221.         if (%opchan. [ $+ [ %.lvl.addr ] ] == $null) { set %oppass. [ $+ [ %.lvl.addr ] ] | .ruser %.lvl %.lvl.addr }
  222.       }
  223.     }
  224.   }
  225.   if ($level(%.lvl.addr) == 1) {
  226.     remini $_ppdir $+ userlist.ini seen %.lvl.addr
  227.     remini $_ppdir $+ userlist.ini nick %.lvl.addr
  228.     .ruser %.lvl.addr
  229.   }
  230.   if (%+nickcolors) {
  231.     set %.match $ial(%.lvl.addr,0)
  232.     if (%.match > 0) {
  233.       :doc
  234.       _nickcol $ial(%.lvl.addr,%.match).nick $ial(%.lvl.addr,%.match).addr $ial(%.lvl.addr,%.match)
  235.       if ($_vd(.match) > 0) goto doc
  236.     }
  237.   }
  238. }
  239. lvl userlevel $1-
  240. user userlevel $1-
  241. userscan {
  242.   if (($me !ison $1) && ($me !ison $active)) _error You must use this command in a channel or specify a target channel you are on.
  243.   if ($me !ison $1) set %.us.chan $active | else set %.us.chan $1
  244.   if (%.us.chan isin %-ial.update) _error The IAL update is not completed yet on  $+ %.us.chan $+ , please wait a few seconds and try again.
  245.   dispa-div
  246.   dispa Scanning %col.target $+ %.us.chan $+  for known users...
  247.   set %.us.num $nick(%.us.chan,0)
  248.   unset %.us.found
  249.   :loop
  250.   set %.us.nick $nick(%.us.chan,%.us.num)
  251.   set %.us.addr $address(%.us.nick,5)
  252.   if ((%.us.nick == $me) || (((%.us.addr == X!cservice@undernet.org) || (%.us.addr == W!cservice@undernet.org)) && (%pp.net == undernet))) goto next
  253.   if (%.us.nick isnotify) {
  254.     set %.us.notify %-+notifymatch. [ $+ [ %.us.nick ] ]
  255.     if (%.us.notify) dispa $chr(160) %col.target $+ %.us.nick $+  is on your notify list, address verified
  256.     elseif (%.us.notify == $null) dispa $chr(160) %col.target $+ %.us.nick $+  is on your notify list, no address check
  257.     else dispa $chr(160) %col.target $+ %.us.nick $+  is on your notify list, address check failed
  258.     inc %.us.found
  259.   }
  260.   set %.us.addr $maddress(%.us.addr)
  261.   set %.us.lvl $level(%.us.addr)
  262.   if (black isin %.us.lvl) { inc %.us.found | dispa $chr(160) %col.target $+ %.us.nick $+  is on your blacklist matching %col.info1 $+ %.us.addr }
  263.   elseif (%.us.lvl != 1) {
  264.     inc %.us.found
  265.     set %.us.aka $readini $_ppdir $+ userlist.ini nick %.us.addr
  266.     if ((%.us.aka == $null) || (%.us.aka == %.us.nick)) dispa $chr(160) %col.target $+ %.us.nick $+  is on your userlist matching %col.info1 $+ %.us.addr $+ , level %col.info1 $+ $remove(%.us.lvl,=)
  267.     else dispa $chr(160) %col.target $+ %.us.nick $+  is on your userlist matching %col.info1 $+ %.us.addr $+  (aka %col.target $+ %.us.aka $+ ), level %col.info1 $+ $remove(%.us.lvl,=)
  268.   }
  269.   :next
  270.   if ($_vd(.us.num) > 0) goto loop
  271.   if (%.us.found > 0) dispa %col.att $+ %.us.found $+  recognized users found.
  272.   else dispa %col.att $+ No $+  recognized users found.
  273.   dispa-div
  274. }
  275. ; -----------------------------------------------------
  276. ; DCC chat logins
  277. ; -----------------------------------------------------
  278. login {
  279.   if ($2 == $null) _quickhelp /login
  280.   disp Logging in to %col.target $+ $1 $+  on port %col.target $+ $2
  281.   if ($longip($1) == $null) { .enable #-dcclogin | .dns $1 | set %-dcclogin $1 | set %-dccloginp $2 | halt }
  282.   else _qlogin $1 $2
  283. }
  284. irclogin {
  285.   if ($1 == $null) _quickhelp /irclogin
  286.   if ($2 == $null) set %-dccloginp 6667
  287.   else set %-dccloginp $2
  288.   disp Signing on to IRC server %col.target $+ $1 $+  on port %col.target $+ %-dccloginp
  289.   if ($longip($1) == $null) { .enable #-dcclogin | .dns $1 | set %-dcclogin $1 | halt }
  290.   else _qlogin $1 $2
  291. }
  292. ; -----------------------------------------------------
  293. ; Clear flood counters
  294. ; -----------------------------------------------------
  295. defld dispa Clearing flood counters... | unset %-flood.* %-recd.* %-alert.* %-+waits.* %-mc.* %-once.* %-lastt.* %-desynch.* %-totalvers %-c.ctcp.* %-c.bytes.* %-soundfld.* %-leech.* %-clonejoin.* %-dban-halt %-showban %-cccfld.* %_edf.* | if (%_oldnick != $null) urn
  296. ; -----------------------------------------------------
  297. ; "Nearby" server collection
  298. ; -----------------------------------------------------
  299. nearserv {
  300.   set %-ns.min 1 | set %-ns.max 2
  301.   if ($left($1,1) == <) set %-ns.max $remove($1,<)
  302.   elseif ($left($2,1) == <) set %-ns.max $remove($2,<)
  303.   if ($left($1,1) == >) set %-ns.min $remove($1,>)
  304.   elseif ($left($2,1) == >) set %-ns.min $remove($2,>)
  305.   if (%-ns.min !isnum) set %-ns.min 1
  306.   if (%-ns.max !isnum) set %-ns.max 2
  307.   if (%-ns.min > %-ns.max) { set %.tmp %-ns.min | set %-ns.min %-ns.max | set %-ns.max %.tmp }
  308.   dispa Collecting nearby servers (hops %col.target $+ %-ns.min $+  to %col.target $+ %-ns.max $+ )
  309.   links | .enable #-nearserv | unset %_ns.found
  310. }
  311. ; -----------------------------------------------------
  312. ; Kick stats
  313. ; -----------------------------------------------------
  314. kickstat {
  315.   if ($1 == $null) _quickhelp /kickstat
  316.   if (. isin $1) set %.nk $1
  317.   else set %.nk $_nickglob($1)
  318.   if (($2 == $null) || ($2 == c)) {
  319.     if (($address(%.nk,5) == $null) && (. !isin %.nk)) _lookup %.nk * kickstat %.nk , $2
  320.     set %.mask $address(%.nk,3)
  321.   }
  322.   else set %.mask $2
  323.   set %.data $readini -n $_ppdir $+ kickstat.ini stats %.mask
  324.   if (%.data == $null) dispa No kick data stored for %col.target $+ %.nk $+ .
  325.   else {
  326.     if (($3 == c) || (($3 == $null) && ($2 == c))) {
  327.       dispa Brief kick data copied to clipboard.
  328.       clipboard Seen %col.target $+ %.nk $+  ( $+ %.mask $+ ) suffer %col.info3 $+ $gettok(%.data,2,32) $+  kicks $+ / $+ %col.info3 $+ $gettok(%.data,3,32) $+  kickbans, last kick by %col.target $+ $gettok($gettok(%.data,6,32),1,33) $+  on %col.target $+ $gettok(%.data,5,32) $+ , reason " $+ %col.info1 $+ $_readprep($gettok(%.data,7-,32)) $+ "
  329.     }
  330.     else {
  331.       dispa You've seen %col.target $+ %.nk $+  ( $+ %.mask $+ ) suffer %col.info3 $+ $gettok(%.data,2,32) $+  kicks and %col.info3 $+ $gettok(%.data,3,32) $+  kickbans
  332.       set %.last $gettok(%.data,6,32)
  333.       dispa Last kick by %col.target $+ $gettok(%.last,1,33) $+  ( $+ $gettok(%.last,2-,33) $+ ) on %col.target $+ $gettok(%.data,5,32) $+ , at $asctime($gettok(%.data,1,32))
  334.       dispa Kick reason was " $+ %col.info1 $+ $_readprep($gettok(%.data,7-,32)) $+ " (for $gettok(%.data,4,32) $+ )
  335.     }
  336.   }
  337. }
  338. kstat kickstat $1-
  339. clrstat {
  340.   if ($1 == $null) _quickhelp /clrstat
  341.   if (. isin $1) set %.nk $1
  342.   else set %.nk $_nickglob($1)
  343.   if ($2 == $null) {
  344.     if (($address(%.nk,5) == $null) && (. !isin %.nk)) _lookup %.nk * clrstat %.nk ,
  345.     set %.mask $address(%.nk,3)
  346.   }
  347.   else set %.mask $2
  348.   remini $_ppdir $+ kickstat.ini stats %.mask
  349.   dispa All kick data cleared for %col.target $+ %.nk $+ .
  350. }
  351. ; -----------------------------------------------------
  352. ; Channel rejoin
  353. ; -----------------------------------------------------
  354. rejoin {
  355.   if ($1 == $null) {
  356.     if ($chan($active) != $active) _error You must use this in a channel or specify a target channel.
  357.     set %.rj.chan $active
  358.   }
  359.   else set %.rj.chan $1
  360.   set %.rj.key $chan(%.rj.chan).key
  361.   .raw part %.rj.chan :rejoining
  362.   .raw join %.rj.chan %.rj.key
  363. }
  364. cycle rejoin $1-
  365. ; -----------------------------------------------------
  366. ; Fake joins
  367. ; -----------------------------------------------------
  368. fakejoin {
  369.   if ($1 == $null) _quickhelp /fakejoin
  370.   set %.fake.to $_patch($1)
  371.   set %.fake.num 8
  372.   :loop
  373.   set %.fake.to %.fake.to $+ $gettok(...,$r(1,4),46)
  374.   if ($_vd(.fake.num) > 0) goto loop
  375.   set %.fake.to %.fake.to $+ 
  376.   .raw join %.fake.to
  377.   .raw mode %.fake.to +int
  378. }
  379. ; -----------------------------------------------------
  380. ; Channel info
  381. ; -----------------------------------------------------
  382. chaninfo {
  383.   if ($1 == $null) {
  384.     if ($chan($active) != $active) _error You must use this in a channel or specify a target channel.
  385.     set %.ci.chan $active
  386.   }
  387.   else set %.ci.chan $1
  388.   set %-cinfo.targ %-cinfo.targ %.ci.chan
  389.   disprs %.ci.chan Retrieving %col.target $+ %.ci.chan $+  channel info...
  390.   .raw mode %.ci.chan | .raw topic %.ci.chan | .raw names %.ci.chan
  391. }
  392. strictinfo {
  393.   if ($1 == $null) {
  394.     if ($chan($active) != $active) _error You must use this in a channel or specify a target channel.
  395.     set %.ci.chan $lower($active)
  396.   }
  397.   else set %.ci.chan $lower($1)
  398.   set %.ci.none $true
  399.   disprs-div %.ci.chan
  400.   disprs %.ci.chan [[ $+ %col.info1 $+ %.ci.chan $+ ] strict modes and topics-
  401.   set %.ci.data %strictmode. [ $+ [ %.ci.chan ] ] | if (%.ci.data != $null) { disprs %.ci.chan [[ $+ %col.info1 $+ %.ci.chan $+ ] Mode strictly enforced- %col.dark $+ %.ci.data | unset %.ci.none }
  402.   set %.ci.data %onopmode. [ $+ [ %.ci.chan ] ] | if (%.ci.data != $null) { disprs %.ci.chan [[ $+ %col.info1 $+ %.ci.chan $+ ] Mode set when opped- %col.dark $+ %.ci.data | unset %.ci.none }
  403.   set %.ci.data %alonemode. [ $+ [ %.ci.chan ] ] | if (%.ci.data != $null) { disprs %.ci.chan [[ $+ %col.info1 $+ %.ci.chan $+ ] Mode set when alone- %col.dark $+ %.ci.data | unset %.ci.none }
  404.   set %.ci.data %stricttopic. [ $+ [ %.ci.chan ] ] | if (%.ci.data != $null) { disprs %.ci.chan [[ $+ %col.info1 $+ %.ci.chan $+ ] Topic strictly enforced- %col.dark $+ %.ci.data | unset %.ci.none }
  405.   set %.ci.data %onoptopic. [ $+ [ %.ci.chan ] ] | if (%.ci.data != $null) { disprs %.ci.chan [[ $+ %col.info1 $+ %.ci.chan $+ ] Topic set when opped- %col.dark $+ %.ci.data | unset %.ci.none }
  406.   set %.ci.data %alonetopic. [ $+ [ %.ci.chan ] ] | if (%.ci.data != $null) { disprs %.ci.chan [[ $+ %col.info1 $+ %.ci.chan $+ ] Topic set when alone- %col.dark $+ %.ci.data | unset %.ci.none }
  407.   if (%.ci.none) disprs %.ci.chan [[ $+ %col.info1 $+ %.ci.chan $+ ] has no modes or topics enforced or automatically set.
  408.   disprs-div %.ci.chan
  409. }
  410. strict {
  411.   if ($1 == $null) _quickhelp /strict
  412.   set %.type Mode | set %.lvl strict | set %.desc strictly enforced
  413.   if (t isin $1) set %.type Topic
  414.   if (o isin $1) { set %.lvl onop | set %.desc set when opped }
  415.   elseif (a isin $1) { set %.lvl alone | set %.desc set when alone on channel }
  416.   if (($_ischan($2)) && ($left($2,1) != +)) { set %.chan $2 | set %.msg $3- }
  417.   else { unset %.chan | set %.msg $2- }
  418.   if ((%.type == topic) && (%.chan == $null)) _error You must specify a channel for topic settings.
  419.   set %.var %.lvl $+ %.type
  420.   if (%.chan != $null) { set %.var %.var $+ . $+ %.chan | set %.chan for %col.target $+ %.chan $+  }
  421.   else set %.chan for %col.target $+ all channels
  422.   if (%.msg == $null) { set % [ $+ [ %.var ] ] | disp %.type %.desc %.chan cleared (set to none) }
  423.   else { set % [ $+ [ %.var ] ] %.msg | disp %.type %.desc %.chan set to - %col.dark $+ %.msg }
  424. }
  425. ; -----------------------------------------------------
  426. ; Server pinging
  427. ; -----------------------------------------------------
  428. sping {
  429.   if ($1 == $null) _quickhelp /sping
  430.   if (. !isin $1) {
  431.     if ($2 == $null) {
  432.       set %.targ $_nickglob($1)
  433.       dispa Looking up server of %col.target $+ %.targ $+ ...
  434.       set %-sping.user %-sping.user %.targ
  435.       set %-+hidewhois. [ $+ [ %.targ ] ] $true
  436.       .enable #-whoisno | .raw whois %.targ | halt
  437.     }
  438.     set %-servping. [ $+ [ $2 ] ] $ticks
  439.     .raw time $2
  440.     disps Pinging server %col.info2 $+ $2
  441.     set %-sping.user $remtok(%-sping.user,$1,32)
  442.     return
  443.   }
  444.   set %-servping. [ $+ [ $1 ] ] $ticks $2
  445.   .raw time $1
  446.   if ($2 == $null) disps Pinging server %col.info2 $+ $1
  447. }
  448. ; -----------------------------------------------------
  449. ; About window
  450. ; -----------------------------------------------------
  451. about {
  452.   set %.win1 @ $+ $chr(160)
  453.   set %.win2 @ $+ $str($chr(160),2)
  454.   set %.win3 @ $+ $str($chr(160),3)
  455.   set %.hi $int($calc( [ $window(-3).h ] / 3))
  456.   set %.hi2 $calc(%.hi * 2)
  457.   set %.wide 100
  458.   window %.win1 0 0 %.wide %.hi @About Arial 799
  459.   window %.win2 $calc( [ $window(-3).w ] - %.wide) %.hi %.wide %.hi @About Arial 799
  460.   window %.win3 0 %.hi2 %.wide %.hi @About Arial 799
  461.   :loop1
  462.   inc %.wide 40
  463.   if (%.wide > $window(-3).w) set %.wide $window(-3).w
  464.   window %.win1 0 0 %.wide %.hi
  465.   window %.win2 $calc( [ $window(-3).w ] - %.wide) %.hi %.wide %.hi
  466.   window %.win3 0 %.hi2 %.wide %.hi
  467.   if (%.wide < $window(-3).w) goto loop1
  468.   set %.char 1
  469.   aline %.win1 $chr(160)
  470.   aline %.win2 $chr(160)
  471.   aline %.win3 $chr(160)
  472.   :loop2
  473.   rline %.win1 1 $right(Peaceááááá,%.char)
  474.   rline %.win2 1 $right(andááááááá,%.char)
  475.   rline %.win3 1 $right(Protection,%.char)
  476.   if ($_vi(.char) < 11) goto loop2
  477.   set %.high 100
  478.   set %.left $calc( [ $window(-3).w ] - 240)
  479.   window -l @@ %.left $calc( [ $window(-3).h ] - 100) 240 100 @About %font.basic
  480.   :loop3
  481.   inc %.high 40
  482.   if (%.high > $window(-3).h) set %.high $window(-3).h
  483.   window @@ %.left $int($calc( [ $window(-3).h ] - %.high)) 240 %.high
  484.   if (%.high < $window(-3).h) goto loop3
  485.   .play -sc [ [ $_ppdir ] $+ ] about.txt 25
  486. }
  487. ; -----------------------------------------------------
  488. ; Ignore wrappers
  489. ; -----------------------------------------------------
  490. ign if (- isin $1) { set %.opt $1 | set %.nick $_nickglob($2) | set %.num $3 } | else { set %.opt -inptk | set %.nick $_nickglob($1) | set %.num $2 } | if (%.nick == $null) _quickhelp /ign | if (%.num !isnum) set %.num 3 | set %.nick $_nickglob(%.nick) | if (($_ismask(%.nick)) || ($address(%.nick,5) != $null)) ignore %.opt $_ppmask(%.nick,%.num) | else ignore %.opt %.nick %.num
  491. unign set %.num $ignore(0) | if (%.num == 0) _error No recent ignores to unignore. | set %_lastunign $ignore(%.num) | ignore -r $ignore(%.num)
  492. reign if (%_lastunign == $null) _error No recent unignores to reignore. | ignore $1 %_lastunign $2-
  493. ; -----------------------------------------------------
  494. ; "Random" nick changer
  495. ; -----------------------------------------------------
  496. rn if (%_oldnick == $null) set %_oldnick $me | set %.nk $left($me,6) | :loop1 | if ($len(%.nk) < 9) { set %.nk %.nk $+ $r(0,9) | goto loop1 } | nick %.nk
  497. urn if (%_oldnick == $null) _error No previous nick to return to (use this after /rn to choose a random nick) | nick %_oldnick | unset %_oldnick
  498. ; -----------------------------------------------------
  499. ; "All" wrapper
  500. ; -----------------------------------------------------
  501. all {
  502.   set %.cmd $remove($remove($remove($1,.),/),-)
  503.   if (%.cmd == $null) {
  504.     if (%+sounds.ame) dispa Sounds played in a channel will be played to ALL channel windows.
  505.     else dispa Sounds played in a channel window will only play to that channel
  506.     return
  507.   }
  508.   if ((%.cmd == on) || (%.cmd == yes)) {
  509.     dispa Sounds played in a channel will be played to ALL channel windows.
  510.     set %+sounds.ame $true | return
  511.   }
  512.   if ((%.cmd == off) || (%.cmd == no)) {
  513.     dispa Sounds played in a channel window will only play to that channel
  514.     set %+sounds.ame $false | return
  515.   }
  516.   set %.+allwrap $true
  517.   $1-
  518.   unset %.+allwrap
  519. }
  520. ; -----------------------------------------------------
  521. ; Blacklist/userlist editing
  522. ; -----------------------------------------------------
  523. blackedit {
  524.   window -c @Blacklist
  525.   window -l $_tabscale(21,34) @Blacklist $_winpos(7%,7%,7%,7%) @Blacklist %font.basic
  526.   titlebar @Blacklist editor
  527.   aline @Blacklist Scanning userlist... please wait...
  528.   aline @Blacklist $chr(160)
  529.   .timer -m 1 1 _be2
  530. }
  531. _be2 {
  532.   set %.ini $_ppdir $+ users.ini
  533.   .save -ru %.ini
  534.   set %.ini.num 1
  535.   :loop1
  536.   set %.ini.line $readini -n %.ini Users [ n $+ [ %.ini.num ] ]
  537.   if (%.ini.line == $null) if ($null == $readini -n %.ini Users [ n $+ [ $calc(%.ini.num +1) ] ] ) goto done
  538.   if ($left(%.ini.line,1) != $chr(59)) {
  539.     set %.ini.lvl $gettok(%.ini.line,1,58)
  540.     if (black isin %.ini.lvl) {
  541.       set %.ini.addr $gettok(%.ini.line,2-,58)
  542.       set %.ini.where $_ppblk(%.ini.addr)
  543.       set %.ini.c $_numtok(32,%.ini.where)
  544.       :loop2
  545.       set %.ini.w $gettok(%.ini.where,%.ini.c,32)
  546.       set %.ini.i %.ini.addr $+ > $+ %.ini.w
  547.       if (%.ini.w == *) set %.ini.w alláchannels
  548.       aline @Blacklist %col.dark $+ %.ini.addr $+      $+ %col.target $+ %.ini.w $+      $+ %col.base $+ $_ppblk(%.ini.i)
  549.       if ($_vd(.ini.c) > 0) goto loop2
  550.     }
  551.   }
  552.   inc %.ini.num
  553.   goto loop1
  554.   :done
  555.   rline @Blacklist 1 Select an entry and right-click for options.
  556.   iline @Blacklist 3  Address      Channel(s)      Reason 
  557. }
  558. useredit {
  559.   window -c @Userlist
  560.   window -l $_tabscale(8,28,32,42,54) @Userlist $_winpos(7%,7%,6%,6%) @Userlist %font.basic
  561.   titlebar @Userlist editor
  562.   aline @Userlist Scanning userlist... please wait...
  563.   aline @Userlist $chr(160)
  564.   .timer -m 1 1 _ue2
  565. }
  566. _ue2 {
  567.   set %.ini $_ppdir $+ users.ini
  568.   .save -ru %.ini
  569.   set %.ini.num 1
  570.   :loop
  571.   set %.ini.line $readini -n %.ini Users [ n $+ [ %.ini.num ] ]
  572.   if (%.ini.line == $null) if ($null == $readini -n %.ini Users [ n $+ [ $calc(%.ini.num +1) ] ] ) goto done
  573.   if (($left(%.ini.line,1) != $chr(59)) && (: isin %.ini.line)) _ULaline $gettok(%.ini.line,2-,58) $_i($line(@Userlist,0))
  574.   inc %.ini.num
  575.   goto loop
  576.   :done
  577.   rline @Userlist 1 Select an entry and right-click for options.
  578.   iline @Userlist 2 (note: nickname is ONLY for reference and might NOT be the last seen or current nickname)
  579.   iline @Userlist 4  Nickname      Mask      Level          Op channels      Added/seen 
  580.   window -b @Userlist
  581. }
  582. ; _ULaline *addr* line# (replaces)
  583. _ULaline {
  584.   if (black isin $level($1)) return
  585.   set %.ini.word $remove($gettok($level($1),2-,44),=)
  586.   if (op isin %.ini.word) {
  587.     set %.ini.word $remtok(%.ini.word,op,44)
  588.     set %.ini.op %opchan. [ $+ [ $1 ] ]
  589.     if ($findtok(%.ini.op,any,32) != $null) set %.ini.op $reptok(%.ini.op,any,alláchannels,32)
  590.     set %.ini.op $_s2cs(%.ini.op)
  591.   }
  592.   else set %.ini.op  $+ %col.misc $+ (none)
  593.   set %.ini.word $_s2cs($_c2s(%.ini.word))
  594.   if (%.ini.word == $null) set %.ini.word  $+ %col.misc $+ (none)
  595.   set %.ini.name $readini $_ppdir $+ userlist.ini nick $1
  596.   if (%.ini.name == $null) set %.ini.name  $+ %col.misc $+ (???)
  597.   set %.ini.time $readini $_ppdir $+ userlist.ini seen $1
  598.   if (%.ini.time == $null) set %.ini.time  $+ %col.misc $+ (???)
  599.   else set %.ini.time $gettok(%.ini.time,2-,32) $gettok($duration($calc($ctime - $gettok(%.ini.time,1,32))),1-2,32) ago
  600.   rline @Userlist $2 %col.target $+ %.ini.name $+      $+ %col.dark $+ $1 $+      $+ %col.target $+ $gettok($level($1),1,44) $+      $+ %col.target $+ %.ini.word $+      $+ %col.target $+ %.ini.op $+      $+ %col.dark $+ %.ini.time
  601. }
  602.